
$(function(){
  
  $("#dialog-confirm").dialog({
      autoOpen: false,
      modal: true
    });

    $(".confirmLink").click(function(e) {
      e.preventDefault();
      var targetUrl = $(this).attr("href");
      var question_text = $(this).attr("alt");
      $("#question_text").html(question_text);
      
      $("#dialog-confirm").dialog({
        buttons : {
          "Ja" : function() {
            window.location.href = targetUrl;
            $("#dialog-confirm").dialog("close");
          },
          "Nein" : function() {
            $(this).dialog("close");
          }
        }
      });

      $("#dialog-confirm").dialog("open");
    });
    
    
});